package com.genius.mobile_page.pingjia.controller;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONObject;
import com.genius.adminmanager.other.entity.ResponseJson;
import com.genius.mobile_page.common.ResponseData;
import com.genius.mobile_page.pingjia.PingjiaUtil;
import com.genius.mobile_page.pingjia.service.PingjiaService;
import com.genius.workflow.log.ControllerLog;



@Controller
public class PingjiaSelectController {
	@Autowired
    @Qualifier("PingjiaSelectService")
	private PingjiaService PingjiaSelectService;
    @RequestMapping("/mobile_pingjia/tocheck")
    public String tocheck(){
        return "/views/unite_platform/mobile_page/pingjia/pingjia_check";
    }
    @RequestMapping("/mobile_pingjia/tochakan")
    public String tochankan(){
        return "/views/unite_platform/mobile_page/pingjia/pingjia_chakan";
    }    
    @RequestMapping("/mobile_pingjia/toindex")
    public String toindex(){
        return "/views/unite_platform/mobile_page/pingjia/pingjia_index";
    }   
    @RequestMapping("/mobile_pingjia/towoyaopj")
    public String towoyaopj(){
        return "/views/unite_platform/mobile_page/pingjia/pingjia_woyaopj";
    }
    @GetMapping("/mobile_pingjia/pingjia_check")  
    public String returnfac(@RequestParam("pId") String pId,ModelMap map) {
    	map.addAttribute("thepId", pId);
        return "/views/unite_platform/mobile_page/pingjia/pingjia_check";
    }
    @GetMapping("/mobile_pingjia/pingjia_woyaopj")  
    public String woyaopj(@RequestParam("userId") String userId,@RequestParam("username") String username,@RequestParam("type") String type,ModelMap map) {
    	map.addAttribute("theuserId", userId);
    	map.addAttribute("theusername", username);
    	map.addAttribute("thetype", type);
        return "/views/unite_platform/mobile_page/pingjia/pingjia_woyaopj";
    }
    @GetMapping("/mobile_pingjia/pingjia_detail")  
    public String pingjia_detail(@RequestParam("userId") String userId,ModelMap map) {
    	map.addAttribute("theuserId", userId);
        return "/views/unite_platform/mobile_page/pingjia/pingjia_chakan";
    }
    @GetMapping("/mobile_page/video_detail")  
    public String video_detail(@RequestParam("id") String id,ModelMap map) {
    	map.addAttribute("theid", id);
        return "/views/unite_platform/mobile_page/sixiang/video";
    }
    @GetMapping("/mobile_page/upload_video")  
    public String upload_video(@RequestParam("shopcode") String shopcode,ModelMap map) {
    	map.addAttribute("theshopcode", shopcode); 
        return "/views/unite_platform/mobile_page/sixiang/upload";
    }
    @RequestMapping("/mobile_page/sixiang_toupload")
    public String toupload(){
        return "/views/unite_platform/mobile_page/sixiang/upload";
    }
    @RequestMapping("/mobile_page/sixiang_toselect")
    public String toselect(){
        return "/views/unite_platform/mobile_page/sixiang/select";
    }
    @RequestMapping("/mobile_page/sixiang_tovideo")
    public String tovideo(){
        return "/views/unite_platform/mobile_page/sixiang/video";
    }

    @RequestMapping("/mobile_pingjia/toPingjia_other_list")
    public String toPingjia_other_list(){
        return "/views/unite_platform/mobile_page/pingjia/pingjia_other_list";
    }
    /**
     * 查询数据
     * @return
     * @throws Exception
     */
    @ControllerLog(description="获取下一级组织架构")
    @PostMapping("/mobile_pingjia/get_next")
    @ResponseBody
    public JSONObject get_next(@RequestBody JSONObject json){
        JSONObject response = new JSONObject();
        response.put(ResponseJson.code, 0);
        response = PingjiaSelectService.get_next(json, response);
        return response;
    }
    /**
     * 查询数据
     * @return
     * @throws Exception
     */
    @ControllerLog(description="获取下一级人")
    @PostMapping("/mobile_pingjia/get_user")
    @ResponseBody
    public JSONObject get_user(@RequestBody JSONObject json){
        JSONObject response = new JSONObject();
        response.put(ResponseJson.code, 0);
        response = PingjiaSelectService.get_user(json, response);
        return response;
    }
    /**
     * 查询数据
     * @return
     * @throws Exception
     */
    @ControllerLog(description="获取下一级组织架构")
    @PostMapping("/mobile_pingjia/get_search_user")
    @ResponseBody
    public JSONObject get_search_user(@RequestBody JSONObject json){
        JSONObject response = new JSONObject();
        response.put(ResponseJson.code, 0);
        response = PingjiaSelectService.get_search_user(json, response);
        return response;
    }
    /**
     * 查询数据
     * @return
     * @throws Exception
     */
    @ControllerLog(description="获取标题")
    @PostMapping("/mobile_pingjia/get_title")
    @ResponseBody
    public JSONObject get_title(@RequestBody JSONObject json){
        JSONObject response = new JSONObject();
        response.put(ResponseJson.code, 0);
        response = PingjiaSelectService.get_title(json, response);
        return response;
    }
    /**
     * 查询数据
     * @return
     * @throws Exception
     */
    @ControllerLog(description="获取组织")
    @PostMapping("/mobile_pingjia/get_zuzhi")
    @ResponseBody
    public JSONObject get_zuzhi(@RequestBody JSONObject json){
        JSONObject response = new JSONObject();
        response.put(ResponseJson.code, 0);
        response = PingjiaSelectService.get_zuzhi(json, response);
        return response;
    }
    /**
     * 查询数据
     * @return
     * @throws Exception
     */
    @ControllerLog(description="获取头像")
    @PostMapping("/mobile_pingjia/get_touxiang")
    @ResponseBody
    public JSONObject get_touxiang(@RequestBody JSONObject json){
        JSONObject response = new JSONObject();
        response.put(ResponseJson.code, 0);
        response = PingjiaSelectService.get_touxiang(json, response);
        return response;
    }
    /**
     * 查询数据
     * @return
     * @throws Exception
     */
    @ControllerLog(description="获取组织")
    @PostMapping("/mobile_pingjia/get_label_dict")
    @ResponseBody
    public JSONObject get_label_dict(@RequestBody JSONObject json){
        JSONObject response = new JSONObject();
        response.put(ResponseJson.code, 0);
        response = PingjiaSelectService.get_label_dict(json, response);
        return response;
    }
    /**
	 * 新增填充操作
	 */
	@PostMapping("/mobile_pingjia/fillid")
	@ResponseBody
	public JSONObject fillid(@RequestBody JSONObject json){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = PingjiaSelectService.fillid(json, response);
		return response;
	}
	/**
	 * 新增填充操作
	 */
	@PostMapping("/mobile_pingjia/Add")
	@ResponseBody
	public JSONObject Add(@RequestBody JSONObject json){
	
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = PingjiaSelectService.Add(json, response);
		return response;
	}
	/**
      * 查询数据
     * @return
     * @throws Exception
     */
    @ControllerLog(description="获取下一级组织架构")
    @PostMapping("/mobile_pingjia/get_label")
    @ResponseBody
    public JSONObject get_label(@RequestBody JSONObject json){
        JSONObject response = new JSONObject();
        response.put(ResponseJson.code, 0);
        response = PingjiaSelectService.get_label(json, response);
        return response;
    }
	/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="获取下一级组织架构")
	 @PostMapping("/mobile_pingjia/getpingjia")
	 @ResponseBody
	 public JSONObject getpingjia(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = PingjiaSelectService.getpingjia(json, response);
	     return response;
	 }
		/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="获取下一级组织架构")
	 @PostMapping("/mobile_pingjia/getstardiv")
	 @ResponseBody
	 public JSONObject getstardiv(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = PingjiaSelectService.getstardiv(json, response);
	     return response;
	 }
		/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="获取下一级组织架构")
	 @PostMapping("/mobile_pingjia/getstar")
	 @ResponseBody
	 public JSONObject getstar(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = PingjiaSelectService.getstar(json, response);
	     return response;
	 }
		/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="获取下一级组织架构")
	 @PostMapping("/mobile_pingjia/get_department")
	 @ResponseBody
	 public JSONObject get_department(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = PingjiaSelectService.get_department(json, response);
	     return response;
	 }
		/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="")
	 @PostMapping("/mobile_page/get_video")
	 @ResponseBody
	 public JSONObject get_video(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = PingjiaSelectService.get_video(json, response);
	     return response;
	 }
		/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="")
	 @PostMapping("/mobile_page/get_today")
	 @ResponseBody
	 public JSONObject get_today(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = PingjiaSelectService.get_today(json, response);
	     return response;
	 }
	/**
	 * 新增填充操作
	 */
	@PostMapping("/mobile_page/save_video")
	@ResponseBody
	public JSONObject save_video(@RequestBody JSONObject json){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	response = PingjiaSelectService.save_video(json, response);
		return response;
	}
	/**
	 * 删除操作
	 */
	@ControllerLog(description="删除工作计划管理")
	@PostMapping("/mobile_page/del_video")
	@ResponseBody
	public JSONObject batchdel(@RequestBody JSONObject json){
		JSONObject response = new JSONObject();
    	response.put(ResponseJson.code, 0);
    	PingjiaSelectService.del_video(json, response);
		return response;
	}
		/**
	  * 查询数据
	  * @return
	  * @throws Exception
	  */
	 @ControllerLog(description="获取门店")
	 @PostMapping("/mobile_page/get_shop")
	 @ResponseBody
	 public JSONObject get_shop(@RequestBody JSONObject json){
	     JSONObject response = new JSONObject();
	     response.put(ResponseJson.code, 0);
	     response = PingjiaSelectService.get_shop(json, response);
	     return response;
	 }

	    @ControllerLog(description="插入各类型评价的信息")
		@PostMapping("/mobile_page/pingjia/insertTypePingjia")
	    @ResponseBody
	    public ResponseData insertTypePingjia(@RequestBody JSONObject parms){
//			log.info("插入各类型评价的信息请求--->"+parms);
			ResponseData resData = PingjiaUtil.insertTypePingjia(parms);
//			log.info("插入各类型评价的信息返回值--->"+resData);
	        return resData;
		}
	    @ControllerLog(description="更改各个类型评价状态")
		@PostMapping("/mobile_page/pingjia/updateTypePingjia")
	    @ResponseBody
	    public ResponseData updateTypePingjia(@RequestBody JSONObject parms){
//			log.info("更改各个类型评价状态请求--->"+parms);
			ResponseData resData = PingjiaUtil.updateTypePingjia(parms);
//			log.info("更改各个类型评价状态返回值--->"+resData);
	        return resData;
		}
	    @ControllerLog(description="查询各个类型评价")
		@PostMapping("/mobile_page/pingjia/getTypePingjia")
	    @ResponseBody
	    public ResponseData getTypePingjia(@RequestBody JSONObject parms){
//			log.info("查询各个类型评价请求--->"+parms);
			ResponseData resData = PingjiaUtil.getTypePingjia(parms);
//			log.info("查询各个类型评价返回值--->"+resData);
	        return resData;
		}
}

